package com.kfm.web.controller.order;

import com.kfm.order.service.AlipayService;
import com.kfm.util.ParamsUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/alipay")
public class AlipayController {

    @Resource
    private AlipayService alipayService;

    // 沙箱支付宝支付成功的回调
    @RequestMapping("/pay/callback")
    public String  notify_url(HttpServletRequest request) throws Exception{
        Boolean result =  alipayService.alipayCallback(ParamsUtil.ParamstoMap(request));
        if(result){
            return "success";
        }else{
            return "false";
        }
    }

}
